/*
 *                    COPYRIGHT NOTICE
 *
 *           This code is copyright protected by Freedom Inc.
 *
 *              2001-2012 All Rights Are Reserved
 */
package com.freedom.oldsong.hr.resource.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.freedom.oldsong.hr.resource.dao.ResourceDao;
import com.freedom.oldsong.hr.resource.model.Resource;
import com.freedom.oldsong.system.dao.impl.BaseDaoImpl;

/**
 * @author steven.wang
 *
 */
public class ResourceDaoImpl extends BaseDaoImpl<Resource> implements ResourceDao {

	@Override
	public List<Resource> findList(Long resourceId, String resourcename) {
		Map params = new HashMap<String, Object>();
		params.put("resourceId", resourceId);
		params.put("resourceName", resourcename);
		return getSqlMapClientTemplate().queryForList(getNameMapping() + ".testList", params);
	}

	@Override
	public Resource findObject(Long resourceId) {
		return (Resource)getSqlMapClientTemplate().queryForObject(getNameMapping() + ".testObject", resourceId);
	}
	
}
